#pragma once

#include "common.h"
#include "searchdialog.h"
#include "index.h"

#include <QtCore/QObject>

class MainWindow;
class Viewer;
class ObjectStorage;
void SEARCH_DLL_EXPORT Init ( MainWindow * window );

class Search : public QObject
{
Q_OBJECT
public:
	Search ();
	~Search ();

	void init ( MainWindow * );

protected slots:
	void onSearchToolSelected ();
	void onMapLoaded ();
	void wantToFind ( QString & );

private:
	Viewer * viewer;
	ObjectStorage * storage;
	
	// gui
	SearchDialog * searchDlg;
	Index index;
};